package cn.weiyang.biz;

import cn.weiyang.dao.DistrictDao;
import cn.weiyang.entity.District;
import cn.weiyang.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * Created by Administrator on 2017/7/10.
 */
public class DistrictBizImpl implements DistrictBiz{
    /**
     * 查询所有区县
     * @return
     */
    public List<District> queryDistrict() {
        SqlSession session=SqlSessionFactoryUtil.getSqlSession();
        DistrictDao dd=session.getMapper(DistrictDao.class);
        List<District> districts=dd.queryDistrict();
        session.close();
        return districts;
    }
}
